/**
 * @单位名称：飞羽个人 Copyright (c) 2017 All Rights Reserved.
 * @系统名称：测试
 * @工程名称：
 * @文件名称:
 * @类路径:
 */
package org.home.sys.bean;

import org.hibernate.validator.constraints.NotBlank;
import org.home.base.bean.BaseBean;
import org.home.base.validate.Add;
import org.home.base.validate.Update;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * @author nanshouxiao
 * @version V1.0.0
 * @date 2017-7-25 17:40:38
 * @see
 */
public class SysUser extends BaseBean {
    /**
     * serialVersionUID
     */
    private static final long serialVersionUID = 1L;

    /**
     * 用户id
     */
    @NotNull(message = "用户id不能为空", groups = {Update.class})
    private Integer userId;

    /**
     * 用户名称
     */
    private String userName;

    /**
     * 登录名
     */
    @Size(message = "登录名必须在{min}-{max}之间", min=4, max = 32, groups = {Add.class, Update.class})
    @NotBlank(message = "用户id不能为空", groups = {Add.class})
    private String loginName;

    /**
     * 密码
     */
    private String password;

    /**
     * 电话
     */
    private String mobile;

    public SysUser() {
    }

    public SysUser(String loginName, String password) {
        this.loginName = loginName;
        this.password = password;
    }

    /**
     * 获取用户id
     */
    public Integer getUserId() {
        return this.userId;
    }

    /**
     * 设置用户id
     */
    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    /**
     * 获取用户名称
     */
    public String getUserName() {
        return this.userName;
    }

    /**
     * 设置用户名称
     */
    public void setUserName(String userName) {
        this.userName = userName;
    }

    /**
     * 获取登录名
     */
    public String getLoginName() {
        return this.loginName;
    }

    /**
     * 设置登录名
     */
    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }

    /**
     * 获取密码
     */
    public String getPassword() {
        return this.password;
    }

    /**
     * 设置密码
     */
    public void setPassword(String password) {
        this.password = password;
    }

    /**
     * 获取电话
     */
    public String getMobile() {
        return this.mobile;
    }

    /**
     * 设置电话
     */
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }


    @Override
    public String toString() {
        return new StringBuilder(super.toString()).append("[")
                .append("userId=").append(getUserId()).append(", ")
                .append("userName=").append(getUserName()).append(", ")
                .append("loginName=").append(getLoginName()).append(", ")
                .append("password=").append(getPassword()).append(", ")
                .append("mobile=").append(getMobile())
                .append("]").toString();
    }
}